package com.ketangpai.mapper;

import com.ketangpai.entity.Student;
import com.ketangpai.entity.Teacher;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author jiahao
 * @date 2024/2/12 22:54
 */
public interface RegisterMapper {
    @Select("select count(*) from user where account = #{account}")
    int queryUser(@Param("account") int account);
    @Insert("insert into user (account,type) values (#{account}, #{type}) ")
    int insertUser(@Param("account")int account,@Param("type")String type);
    @Insert("insert into student (sid, sname, spassword, school, saccount) VALUES (#{sid},#{sname},#{spassword},#{school},#{saccount})")
    int insertStudent(Student student);
    @Insert("insert into teacher (taccount, tname, tpassword, school) VALUES (#{taccount},#{tname},#{tpassword},#{school})")
    int insertTeacher(Teacher teacher);
}
